import { createRouter, createWebHistory } from 'vue-router'
//import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // {
    //   path: '/',
    //   name: 'home',
    //   component: HomeView,
    // },
    // {
    //   path: '/about',
    //   name: 'about',
    //   // route level code-splitting
    //   // this generates a separate chunk (About.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import('../views/AboutView.vue'),
    // },
    {
      path: '/',
      name: 'Login',
      component: () => import('../views/LoginView.vue'),
    },
    {
      path: '/Main',
      name: 'Main',
      component: () => import('../views/MainView.vue'),
      children: [
        {//库房管理
          path: '/warehouse',
          name: 'warehouse',
          component: () => import('../views/BasicData/WareHouse.vue'),
        },
        {//库区管理
          path: '/storagearea',
          name: 'storagearea',
          component: () => import('../views/BasicData/StorageArea.vue'),
        },
        {//货架管理
          path: '/shelf',
          name: 'shelf',
          component: () => import('../views/BasicData/ShelfView.vue'),
        },
        //物资分类
        {
          path: '/Category',
          name: 'Category',
          component: () => import('../views/Category/CategoryView.vue'),
        },
        //角色管理
        {
            path: '/Main/Role',
          name: 'Role',
          component: () => import('../views/RBAC/RoleView.vue'),
        },
        {//物资管理
           path: '/Material',
           name:'Material',
           component: () => import('../views/Category/MaterialView.vue'),
        },
        {
          path: '/Main/User',
          name: 'User',
          component: () => import('../views/RBAC/UserView.vue'),
        },
      ]
    }
  ],
})

export default router
